Mule : PGP Security
This page last changed on May 31, 2006 by tcarlson.
PGP SecurityThis extension adds PGP security on endpoint communication. RequirementsYou need to add these libraries to Mule classpath:
Configuring PGP filterUsing a spring context, we have to define a manager for accessing public and private keys. securityContext.xml <beans> <bean id="pgpKeyManager" class="org.mule.extras.pgp.PGPKeyRingImpl" init-method="initialise"> <property name="publicKeyRingFileName"> <value>pubring.gpg</value> </property> <property name="secretKeyRingFileName"> <value>secring.gpg</value> </property> <property name="secretAliasId"> <value>0x6168F39C</value> </property> <property name="secretPassphrase"> <value>TestingPassphrase</value> </property> </bean> <bean id="fakeCredentialAccessor" class="org.mule.extras.pgp.FakeCredentialAccessor" /> </beans> Also we need to know who is the sender of a message.
Our goal is to define a sample echo application that reads signed (and encrypted) files from a directory (/temp/signedAndEncryptedFiles/in) Then comes Mule configuration... <mule-configuration id="Test_Mule_Properties" version="1.0"> <!-- Spring context --> <container-context className="org.mule.extras.spring.SpringContainerContext"> <properties> <property name="configFile" value="securityContext.xml"/> </properties> </container-context> <!-- Security manager --> <security-manager> <security-provider name="PgpProvider" className="org.mule.extras.pgp.PGPSecurityProvider"> <properties> <container-property name="keyManager" reference="pgpKeyManager"/> </properties> </security-provider> <encryption-strategy name="KBE" className="org.mule.extras.pgp.KeyBasedEncryptionStrategy"> <properties> <container-property name="keyManager" reference="pgpKeyManager" /> </properties> </encryption-strategy> </security-manager> <model name="echoTest"> <mule-descriptor name="echo" containerManaged="false" implementation="org.mule.extras.pgp.EchoMsg"> <inbound-router> <endpoint address="file:///temp/signedAndEncryptedFiles/in"> <security-filter className="org.mule.extras.pgp.filters.PGPSecurityFilter"> <properties> <property name="strategyName" value="KBE"/> <property name="signRequired" value="true"/> <container-property name="credentialsAccessor" reference="fakeCredentialAccessor"/> <container-property name="keyManager" reference="pgpKeyManager" /> </properties> </security-filter> </endpoint> </inbound-router> <outbound-router> <router className="org.mule.routing.outbound.OutboundPassThroughRouter"> <endpoint address="file:///temp/decryptedFiles/out" > <security-filter className="org.mule.extras.pgp.filters.PGPSecurityFilter"> <properties> <property name="strategyName" value="KBE"/> <property name="authenticate" value="false"/> <container-property name="credentialsAccessor" reference="fakeCredentialAccessor"/> <container-property name="keyManager" reference="pgpKeyManager" /> </properties> </security-filter> </endpoint> </router> </outbound-router> </mule-descriptor> </model> </mule-configuration> The property signRequired in the inbound security filter controls if we accept unsigned message or not. the property authenticate in the outbound security filter controls if we want to encrypt messages for the receiver
..and they said "free email account"...but I read "free persistent message queue"... |
Document generated by Confluence on Nov 27, 2006 10:27 |